import json
from server.result.result_code import ResultCode


class Result:

    @staticmethod
    def success():
        return json.dumps({
            'code': ResultCode.SUCCESS.value,
            'message': "success"
        })

    @staticmethod
    def success_data(data):
        return json.dumps({
            'code': ResultCode.SUCCESS.value,
            'message': "success",
            'data': data
        })

    @staticmethod
    def error(code, message):
        return json.dumps({
            'code': code,
            'message': message
        })
